package cn.wolfcode.luowowo.search.impl;

import cn.wolfcode.luowowo.repository.UserInfoTemplateRepository;
import cn.wolfcode.luowowo.search.service.IUserInfoSearchService;
import cn.wolfcode.luowowo.search.template.UserInfoTemplate;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class UserInfoSearchServiceImpl implements IUserInfoSearchService {

    @Autowired
    private UserInfoTemplateRepository repository;

    /**
     * 游记对象的es保存操作
     */
    public void save(UserInfoTemplate template) {
        repository.save(template);
    }

    /**
     *站内搜索之通过目的地的(城市)名字查询用户
     * @param city
     * @return
     */
    public List<UserInfoTemplate> listByCity(String city) {
        return repository.findByCity(city);
    }
}
